
var tableData = {
		url:ctp+"/sysdictController/dictTypeSearch.shtml", 
		propertys : ["NAME","TYPE"],
		hidden:["key=REC_ID"], 
	    hrefs:[["function=dictTypeUpdate","recId=REC_ID","修改",null]],
		startLoad:function (){ 
		getListData(this);	 
	}
};
function searchData(curr){
	setTagAndValue("form1","curr",curr); 
	tableData.startLoad();
}
$(document).ready(function(){
	searchData();
});


function dictDel(){
	var recIds=getCheckIds();	
	if(recIds==''){
		jalert("请选择要删除的记录！");
		return false;
	}
	jconfirm("del('"+recIds+"')","是否要删除所选记录？");	
}
function del(recIds){
	 $.ajax({ 
		 	url: ctp + "/sysdictController/dictTypeDelete.shtml",
		    data: {recIds:recIds},
			type : 'POST',
			async:false, 
			success : function(result) {  
				if(result=="") {  
					jalert("删除成功！"); 		
					  var curr = "1";
					  if($("#form1").find("#curr").length>0){
						  curr = $("#curr").val();
					  }
					  searchData(curr);
				} 		  
				else{     
					jalert(result);   
				} 
	  		}
		});
}

//修改
function dictTypeUpdate(recId){
	dialogWin(550,450,ctp+"/sysdictController/dictTypeUpdate.shtml?recId=" + recId,"");
}
//新增
function typeAddPage(){
	dialogWin(550,450,ctp+"/sysdictController/typeAddPage.shtml","");
}

function back(){
	//location.href=ctp+"/sysdictController/dict.shtml";
	history.back();
}

//重置密码
function resetPwd(){
	var recIds=getCheckIds(null,"dictid");
	if (recIds=='') {
		jalert("请选择记录！");
		return false;
	}
	jconfirm("doReset('"+recIds+"')", "确定要重置所选用户的密码吗？");
}

function doReset(recIds){
	$.ajax({
		url : ctp + "/sysdictController/resetPwd.shtml",
		data : {
			recIds : recIds
		},
		type : 'POST',
		async : false,
		success : function(result) {
				jalert9(result);
				setTimeout(function(){
					searchData();
				},1000);
		}
	});
}